1, 
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cout << i << " " << i << " ";
    }
    return 0;
}

2,
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> arr(2 * n);
    for (int i = 0; i < 2 * n; ++i) {
        cin >> arr[i];
    }

    vector<int> count(n + 1, 0);
    vector<int> perm1, perm2;

    for (int num : arr) {
        if (count[num] == 0) {
            perm1.push_back(num);
            count[num] = 1;
        }
        else {
            perm2.push_back(num);
            count[num] = 2;
        }
    }

    for (int num : perm1) {
        cout << num << " ";
    }
    cout << endl;
    for (int num : perm2) {
        cout << num << " ";
    }
    cout << endl;

    return 0;
}